package com.example.springboot.service;

import com.example.springboot.entity.Approval;
import com.example.springboot.mapper.ApprovalMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ApprovalService {
    @Autowired
    private ApprovalMapper approvalMapper;

    public int save(Approval approval){
        if(approval.getId()==null){
            return approvalMapper.insert(approval);
        }else{
            return approvalMapper.update(approval);
        }
    }
}
